import { _decorator, Vec3 , Node} from 'cc';
import { SkillManager } from './SkillManager';
import { EAnimationPlayMode, EBuff, EGroup, EntityType, ESkill, ESkillType } from '../Config/Enum';
import ObjectPoolManager from '../Core/ObjectPoolManager';
import { Collider2D } from 'cc';
import { PlayerManager } from '../PlayerManager';
import { buffConfig, SkillConfig } from '../Config/SkillConfig';
import { EnemyManager } from '../EnemyManager';

const { ccclass } = _decorator;
// 丐帮武学1投石问路造成的爆炸，持续2秒

@ccclass('WudangBo')
export class WudangBo extends SkillManager {

    runeId
    effectChance
    buffTypeList
    buffDuration
    playSpeed: number;


    pm

    init(type: ESkill, pm: PlayerManager) {

        // 重置所有状态
        this.pm = pm;
        this.skillType = ESkillType.Forward
        this.moveSpeed = 400
        this.animationPlayMode = EAnimationPlayMode.Loop,
        //this.reset();
        super.initOtherSkill(type, pm);


        // 其他符文效果
        switch (this.runeId) {
            case 1:
                break;
            case 2:

                break;  
            case 3:


                break;
        }

        console.log("WudangBo init pm", this.pm);


    }

    protected onHitEnemy(self, other: Collider2D): void {
        this.em = other.node.getComponent(EnemyManager);





        switch (this.runeId) {
            case 1:

                break;
            case 2:
                break;
            case 3: // TODO
                break;
            default:
                break;
        }

        super.onHitEnemy(self, other);

    }



// reset() {
//     this._hasSplit = false;
//     this.isMasterBullet = true;
//     this.direction = new Vec3(0, 0, 0);
//     this._contactPosition = new Vec3(0, 0, 0);
// }





}